package chuishop.yiqimaicai.service.Impl;

import chuishop.yiqimaicai.mapper.GoodsInfoMapper;
import chuishop.yiqimaicai.pojo.GoodsInfo;
import chuishop.yiqimaicai.service.GoodsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsInfoServiceImpl implements GoodsInfoService {

    @Autowired
    private GoodsInfoMapper goodsInfoMapper;

    @Override
    public List<GoodsInfo> findAllGoodsInfo() {
        return goodsInfoMapper.findAllGoodsInfo();
    }

    @Override
    public List<GoodsInfo> selectGoodsInfoByName(String input) {
        return goodsInfoMapper.selectGoodsInfoByName(input);
    }

    @Override
    public boolean addGoodsInfo(GoodsInfo goodsInfo) {
        return goodsInfoMapper.addGoodsInfo(goodsInfo)>0;
    }

    @Override
    public boolean deleteGoodsInfo(String[] ids) {
        return goodsInfoMapper.deleteGoodsInfo(ids)>0;
    }

    @Override
    public boolean updateGoodsInfo(GoodsInfo goodsInfo) {
        return goodsInfoMapper.updateGoodsInfo(goodsInfo)>0;
    }
}
